<template>
  <a-card :bordered="false">
    <!-- 查询区域 -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline">
        <a-row :gutter="24">

          <a-col :xl="4" :lg="7" :md="8" :sm="24">
            <a-form-item label="班级">
              <j-select-banji  v-model="queryParam.bjid" placeholder="请选择班级"></j-select-banji>
<!--              <j-dict-select-tag  v-model="queryParam.bjid" placeholder="请选择班级"-->
<!--                                  dictCode="edu_dev_open.ve_jw_bjgg,name,id" ></j-dict-select-tag>-->
            </a-form-item>
          </a-col>

          <a-col :xl="6" :lg="11" :md="12" :sm="24">
            <a-form-item label="总结时间">
              <j-date
                placeholder="请选择开始日期"
                class="query-group-cust"
                v-model="queryParam.addtime_begin"
              ></j-date>
              <span class="query-group-split-cust"></span>
              <j-date placeholder="请选择结束日期" class="query-group-cust" v-model="queryParam.addtime_end"></j-date>
            </a-form-item>
          </a-col>

          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
              <a @click="handleToggleSearch" style="margin-left: 8px">
                {{ toggleSearchStatus ? '收起' : '展开' }}
                <a-icon :type="toggleSearchStatus ? 'up' : 'down'" />
              </a>
            </span>
          </a-col>

        </a-row>
      </a-form>
    </div>

    <!-- 操作按钮区域 -->
    <div class="table-operator" :md="24" :sm="24" style="margin: 0px 0px 10px 2px">
      <a-button @click="handleAdd" type="primary" icon="plus">添加</a-button>

      <a-dropdown v-if="selectedRowKeys.length > 0">
        <a-menu slot="overlay">
          <a-menu-item key="1" @click="batchDel">
            <a-icon type="delete"/>
            删除
          </a-menu-item>
        </a-menu>
        <a-button style="margin-left: 8px"> 批量操作
          <a-icon type="down"/>
        </a-button>
      </a-dropdown>
    </div>

    <!-- table区域-begin -->
    <div>
      <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
        <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
        <a style="margin-left: 24px" @click="onClearSelected">清空</a>
      </div>

      <a-table
        ref="table"
        size="middle"
        bordered
        rowKey="id"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
        @change="handleTableChange">

        <span slot="action" slot-scope="text, record">
          <a @click="updateEdit(record)">修改</a>
          <a-divider type="vertical"/>
          <a @click="checkBjgg(record)">查看</a>

        </span>

      </a-table>
    </div>
    <!-- table区域-end -->

    <!-- 表单区域 -->
    <VeJwBjggModal ref="modalForm" @ok="modalFormOk"></VeJwBjggModal>
    <VeJwBjggCheckModal ref="checkModalForm" @ok="modalFormOK"></VeJwBjggCheckModal>
  </a-card>
</template>

<script>
  import {EduListMixin} from '@/mixins/EduListMixin'
  import {getAction} from '@/api/manage'
  import VeJwBjggModal from './modules/VeJwBjggModal'
  import VeJwBjggCheckModal from './modules/VeJwBjggCheckModal'
  import { formatDate } from '@/utils/util'
  import JSelectBanji from '../../components/kwglbiz/JSelectBanji'

  export default {
    name: "EduOrderTicketList",
    mixins: [EduListMixin],
    components: {
      JSelectBanji,
      VeJwBjggModal,
      VeJwBjggCheckModal,
    },
    data() {
      return {
        description: 've_jw_bjgg管理页面',
        // 表头
        columns: [
          {
            title: '#',
            dataIndex: '',
            key:'rowIndex',
            width:60,
            align:"center",
            customRender:function (t,r,index) {
              return parseInt(index)+1;
            }
          },
          {
            title:'班级名称',
            align:"center",
            dataIndex: 'bjmc'
          },
          {
            title:'标题',
            align:"center",
            dataIndex: 'title'
          },
          {
            title:'日期',
            align:"center",
            dataIndex: 'addtime',
            customRender:function (text) {
              return !text?"":(text.length>10?text.substr(0,10):text)
            }
          },
          {
            title:'记录人',
            align:"center",
            dataIndex: 'addusername'
          },
          {
            title:'评审结果',
            align:"center",
            dataIndex: 'verifystatus_dictText'
          },
          // {
          //   title:'审核人',
          //   align:"center",
          //   dataIndex: 'verifyuser'
          // },
          {
            title:'评审人',
            align:"center",
            dataIndex: 'verifyusername'
          },
          {
            title:'评审时间',
            align:"center",
            dataIndex: 'verifytime',
            customRender:function (text) {
              return !text?"":(text.length>10?text.substr(0,10):text)
            }
          },
          {
            title: '操作',
            dataIndex: 'action',
            align:"center",
            scopedSlots: { customRender: 'action' }
          }
        ],
        url: {
          list: "/teacherWork/veJwBjgg/list",
          delete: "/teacherWork/veJwBjgg/delete",
          deleteBatch: "/teacherWork/veJwBjgg/deleteBatch",
          exportXlsUrl: "/teacherWork/veJwBjgg/exportXls",
          importExcelUrl: "teacherWork/veJwBjgg/importExcel",
        },
        dictOptions:{},
        isorter: []
      }
    },
    computed: {
      importExcelUrl: function(){
        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
      }
    },
    methods: {
      initDictConfig(){
      },
      //我的班级公告-查看我的班级公告
      checkBjgg:function(record){
        this.$refs.checkModalForm.edit(record);
        this.$refs.checkModalForm.title="查看我的班级公告";
        this.$refs.checkModalForm.disableSubmit=false;
      },

      //我的班级公告-修改我的班级公告
      updateEdit: function (record) {
        this.$refs.modalForm.edit(record);
        this.$refs.modalForm.title = "修改我的班级公告";
        this.$refs.modalForm.disableSubmit = false;
      },

      handleAdd: function () {
        this.$refs.modalForm.add();
        this.$refs.modalForm.title = "新增班级公告";
        this.$refs.modalForm.disableSubmit = false;
      },

    }
  }
</script>
<style scoped>
  @import '~@assets/less/usercolor.less'
</style>